<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
    <title>Intro to SceneLayer | Sample | ArcGIS API for JavaScript 4.18</title>
    <style>
        html,
        body,
        #viewDiv {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }
    </style>

    <link rel="stylesheet" href="https://js.arcgis.com/4.18/esri/themes/light/main.css"/>
    <script src="https://js.arcgis.com/4.18/"></script>

    <script>
        require([
            "esri/Map",
            "esri/views/SceneView",
            "esri/layers/SceneLayer"
        ], function (Map, SceneView, SceneLayer) {
            let map = new Map({
                basemap: "dark-gray-vector",
                ground: "world-elevation"
            });

            let view = new SceneView({
                container: "viewDiv",
                map: map,
                camera: {
                    position: [-74.0338, 40.6913, 707],
                    tilt: 81,
                    heading: 50
                }
            });

            let sceneLayer = new SceneLaye({
                portalItem: {
                    id: "2e0761b9a4274b8db52c4bf34356911e"
                },
                popupEnabled: true
            });
            map.add(sceneLayer);


            //将渲染器添加到sceneLayer
            sceneLayer.renderer = {
                type: "simple",
                symbol: {
                    type: "mesh-3d",
                    symbolLayers: [{
                        type: "fill",
                        material: { color: "#e54d42" } //渲染的白膜的颜色
                    }]
                }
            };
        });
    </script>
</head>

<body>
<div id="viewDiv"></div>
</body>
</html>
